package com.jinniulive.platform.tools;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/12/9.
 */
//{"UserID":9391233,"NickName":"yang","UserLevel":10,"FaceIndex":212,"MngLevel":0,"MicState":0}]}
public class UsersManage {

    private static List<UserBean> mUserBeanList;

    public  UsersManage() {
        mUserBeanList = new ArrayList<>();
    }

    public static void AddUsers(int userId, String nickName, int userLevel, int faceIndex, int mngLevel, int micState){
        for (int i = 0; i < mUserBeanList.size(); i++) {
            if (mUserBeanList.get(i).getUserId()==userId){
                return;
            }
        }
        UserBean userBean=new UserBean();
        userBean.setFaceIndex(faceIndex);
        userBean.setMicState(micState);
        userBean.setMngLevel(mngLevel);
        userBean.setNickName(nickName);
        userBean.setUserId(userId);
        userBean.setUserLevel(userLevel);
        mUserBeanList.add(userBean);
    }

    public static List<UserBean> getmUserBeanList() {
        return mUserBeanList;
    }

    public static int getUserCount(){
        return mUserBeanList.size();
    }
    public static void DeleteUser(int userId){
        for (int i = 0; i < mUserBeanList.size(); i++) {
            if (mUserBeanList.get(i).getUserId()==userId){
               mUserBeanList.remove(i);
                return;
            }
        }
    }
    public static String GetUserNickName(int userId){
        for (int i = 0; i < mUserBeanList.size(); i++) {
            if (mUserBeanList.get(i).getUserId()==userId){
                return mUserBeanList.get(i).getNickName();
            }
        }
        return null;
    }

    public static class UserBean{
        private static int userId;
        private static String nickName;
        private static int userLevel;
        private static int faceIndex;
        private static int mngLevel;
        private static int micState;

        public   int getUserId() {
            return userId;
        }

        public  void setUserId(int userId) {
            this.userId = userId;
        }

        public  String getNickName() {
            return nickName;
        }

        public void setNickName(String nickName) {
            this.nickName = nickName;
        }

        public  int getUserLevel() {
            return userLevel;
        }

        public void setUserLevel(int userLevel) {
            this.userLevel = userLevel;
        }

        public  int getFaceIndex() {
            return faceIndex;
        }

        public void setFaceIndex(int faceIndex) {
            this.faceIndex = faceIndex;
        }

        public int getMngLevel() {
            return mngLevel;
        }

        public void setMngLevel(int mngLevel) {
            this.mngLevel = mngLevel;
        }

        public int getMicState() {
            return micState;
        }

        public void setMicState(int micState) {
            this.micState = micState;
        }
    }
}
